<style scoped>
    .layout{
        border: 1px solid #d7dde4;
        background: #f5f7f9;
        position: relative;
        border-radius: 4px;
        overflow: hidden;
        height: 100%;
    }
    .layout-header-bar{
        background: #fff;
        box-shadow: 0 1px 1px rgba(0,0,0,.1);
    }
    .layout-logo-left{
        width: 90%;
        height: 30px;
        background: #5b6270;
        border-radius: 3px;
        margin: 15px auto;
    }
    .menu-icon{
        transition: all .3s;
    }
    .rotate-icon{
        transform: rotate(-90deg);
    }
    .menu-item span{
        display: inline-block;
        overflow: hidden;
        width: 120px;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: bottom;
        transition: width .2s ease .2s;
    }
    .menu-item i{
        transform: translateX(0px);
        transition: font-size .2s ease, transform .2s ease;
        vertical-align: middle;
        font-size: 16px;
    }
    .collapsed-menu span{
        width: 0px;
        transition: width .2s ease;
    }
    .collapsed-menu i{
        transform: translateX(5px);
        transition: font-size .2s ease .2s, transform .2s ease .2s;
        vertical-align: middle;
        font-size: 22px;
    }

    .layout-logo{
        width: 300px;
        height: 30px;
        line-height: 30px;
        border-radius: 3px;
        float: left;
        position: relative;
        top: 15px;
        left: 20px;
        color: white;
        font-size: 20px;
    }
    .layout-nav{
        float:right;
        margin: 0 auto;
        margin-right: 10px;
    }
    .layout-footer-center{
        text-align: center;
        /*position: absolute;*/
        /*bottom: 0px;*/
        /*left: 0px;*/
        width: 100%;
    }
    .main{
        margin-top: 65px;
        height: 100%;
    }
    .content{
        height: 100%;
    }

</style>
<template>
    <div class="layout">
        <Layout class="content">
            <Header :style="{position: 'fixed', width: '100%'}">
                <Menu mode="horizontal" theme="dark" active-name="1">
                    <div class="layout-logo">徐州市经济开发区高级人才分布图</div>
                    <div class="layout-nav">
                        <MenuItem name="2">
                            <Icon type="ios-keypad"></Icon>
                            个人中心
                        </MenuItem>
                    </div>
                </Menu>
            </Header>
            <Layout class="main">
                <Sider ref="side1" hide-trigger collapsible :collapsed-width="78" v-model="isCollapsed">
                    <Menu active-name="1-1" theme="dark" width="auto" :class="menuitemClasses">
                        <MenuItem name="1-1">
                            <Icon type="ios-bookmarks"></Icon>
                            <span>按学历分布</span>
                        </MenuItem>
                        <MenuItem name="1-8">
                            <Icon type="android-clipboard"></Icon>
                            <span>按专业分布</span>
                        </MenuItem>
                        <MenuItem name="1-7">
                            <Icon type="ios-people-outline"></Icon>
                            <span>按年龄段分布</span>
                        </MenuItem>
                        <MenuItem name="1-2">
                            <Icon type="transgender"></Icon>
                            <span>按性别分布</span>
                        </MenuItem>
                        <MenuItem name="1-9">
                            <Icon type="ios-people"></Icon>
                            <span>按职称分布</span>
                        </MenuItem>
                        <MenuItem name="1-3">
                            <Icon type="settings"></Icon>
                            <span>按企业类型分布</span>
                        </MenuItem>
                        <MenuItem name="1-4">
                            <Icon type="shuffle"></Icon>
                            <span>按流动形式分布</span>
                        </MenuItem>
                        <MenuItem name="1-5">
                            <Icon type="flag"></Icon>
                            <span>按企业规模分布</span>
                        </MenuItem>
                        <MenuItem name="1-6">
                            <Icon type="ios-world"></Icon>
                            <span>按区域分布</span>
                        </MenuItem>

                    </Menu>
                </Sider>
                <Layout>
                    <Header :style="{padding: 0}" class="layout-header-bar">
                        <Icon @click.native="collapsedSider" :class="rotateIcon" :style="{margin: '20px 20px 0'}" type="navicon-round" size="24"></Icon>
                    </Header>
                    <Content :style="{margin: '20px', background: '#fff', minHeight: '260px'}">
                        <router-view></router-view>
                    </Content>
                </Layout>
            </Layout>
        </Layout>
    </div>
</template>
<script>
    export default {
        data () {
            return {
                isCollapsed: false
            }
        },
        computed: {
            rotateIcon () {
                return [
                    'menu-icon',
                    this.isCollapsed ? 'rotate-icon' : ''
                ];
            },
            menuitemClasses () {
                return [
                    'menu-item',
                    this.isCollapsed ? 'collapsed-menu' : ''
                ]
            }
        },
        methods: {
            collapsedSider () {
                this.$refs.side1.toggleCollapse();
            }
        }
    }
</script>